﻿using System;
using Autofac;
using hello.csharp.consoleApp.LogicTest;
using hello.csharp.consoleApp.StorageTest;
using hello.csharp.kernel;

namespace hello.csharp.consoleApp
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var builder = new ContainerBuilder();
            IoCManager.Instance.Register(builder);
            builder.RegisterType<Firster>().AsSelf().SingleInstance();

            builder.RegisterType<UserStorageTest>().AsSelf().SingleInstance();
            builder.RegisterType<ProductStorageTest>().AsSelf().SingleInstance();
            builder.RegisterType<AccountRegisterTest>().AsSelf().SingleInstance();

            using (var container = builder.Build())
            {
                var bootstrap = container.Resolve<Firster>();
                bootstrap.Run();
            }
        }
    }
}